# -*- coding: utf-8 -*- 
#
# Description:
#
#  Definiton
#
#
#
# Changes:
#
# 2012-01-10
# Initial Commit
#
#
# Copyright 2010-2012, WyDev Team.
# Author: Polo35 (polo35580@hotmail.fr)
#
# Licenced under Academic Free License version 3.0
# Review WyGui README & LICENSE files for further details.

nname: 0
n 0(None)[self._login = None
self._password = None
return None
]:
	i: 
	o: 

self.nodes: {0: <unpyclib.structure.node instance at 0xb758e16c>}
nname: 49
n 49(None)[]:
	i: 24(), 38()
	o: 

nname: 38
n 38(None)[self._set_new_password()
]:
	i: 0(f)
	o: 49()

nname: 24
n 24(None)[self._set_new_login()
]:
	i: 0(t)
	o: 49()

nname: 0
n 0(self.what_to_launch in (0, 2))[self.what_to_launch = what_to_launch
]:
	i: 
	o: 24(t), 38(f)

nname: 0
n 0(None)[self.what_to_launch = what_to_launch
if self.what_to_launch in (0, 2):
	self._set_new_login()
else:
	self._set_new_password()
]:
	i: 
	o: 

self.nodes: {0: <unpyclib.structure.node instance at 0xb758e4cc>}
nname: 59
n 59(None)[kbd = KeyboardWindow(title=_('Enter your password'), confirm_action=self._validate)
kbd.show()
return None
]:
	i: 45(), 58()
	o: 

nname: 58
n 58(None)[]:
	i: 0(f)
	o: 59()

nname: 45
n 45(None)[win.hide()
]:
	i: 28(), 44()
	o: 59()

nname: 44
n 44(None)[]:
	i: 12(f)
	o: 45()

nname: 28
n 28(None)[self._login = win.text
]:
	i: 12(t)
	o: 45()

nname: 12
n 12(self.what_to_launch == 2)[]:
	i: 0(t)
	o: 28(t), 44(f)

nname: 0
n 0(win is not None)[]:
	i: 
	o: 12(t), 58(f)

nname: 59
n 59(None)[kbd = KeyboardWindow(title=_('Enter your password'), confirm_action=self._validate)
kbd.show()
return None
]:
	i: 12(), 0(f)
	o: 

nname: 12
n 12(None)[if self.what_to_launch == 2:
	self._login = win.text
win.hide()
]:
	i: 0(t)
	o: 59()

nname: 0
n 0(win is not None)[]:
	i: 
	o: 12(t), 59(f)

nname: 0
n 0(None)[if win is not None:
	if self.what_to_launch == 2:
		self._login = win.text
	win.hide()
kbd = KeyboardWindow(title=_('Enter your password'), confirm_action=self._validate)
kbd.show()
return None
]:
	i: 
	o: 

self.nodes: {0: <unpyclib.structure.node instance at 0xb758e3ac>}
nname: 32
n 32(None)[_confirm_action = self._validate
kbd = KeyboardWindow(title=_('Enter your login'), confirm_action=_confirm_action)
kbd.show()
]:
	i: 15(), 25()
	o: 

nname: 25
n 25(None)[]:
	i: 0(f)
	o: 32()

nname: 15
n 15(None)[]:
	i: 0(t)
	o: 32()

nname: 0
n 0(self.what_to_launch == 2)[]:
	i: 
	o: 15(t), 25(f)

nname: 0
n 0(None)[if self.what_to_launch == 2:
	pass
_confirm_action = self._validate
kbd = KeyboardWindow(title=_('Enter your login'), confirm_action=_confirm_action)
kbd.show()
]:
	i: 
	o: 

self.nodes: {0: <unpyclib.structure.node instance at 0xb758e96c>}
nname: 203
n 203(None)[user_config.save()
louie_send('refresh_root', sender='navigator')
return None
]:
	i: 152(), 202()
	o: 

nname: 202
n 202(None)[]:
	i: 137(f)
	o: 203()

nname: 152
n 152(None)[user_config['net']['password'] = self._password
log.info("'pass' param set for net services'")
set_param('pass', self._password)
]:
	i: 137(t)
	o: 203()

nname: 137
n 137(self._password is not None)[]:
	i: 86(), 136()
	o: 152(t), 202(f)

nname: 136
n 136(None)[]:
	i: 71(f)
	o: 137()

nname: 86
n 86(None)[user_config['net']['login'] = self._login
log.info("'user' param set for net services'")
set_param('user', self._login)
]:
	i: 71(t)
	o: 137()

nname: 71
n 71(self._login is not None)[]:
	i: 57(), 70()
	o: 86(t), 136(f)

nname: 70
n 70(None)[]:
	i: 0(f)
	o: 71()

nname: 57
n 57(None)[win.hide()
]:
	i: 28(), 44()
	o: 71()

nname: 44
n 44(None)[self._login = win.text
]:
	i: 12(f)
	o: 57()

nname: 28
n 28(None)[self._password = win.text
]:
	i: 12(t)
	o: 57()

nname: 12
n 12(self.what_to_launch in (0, 2))[]:
	i: 0(t)
	o: 28(t), 44(f)

nname: 0
n 0(win is not None)[]:
	i: 
	o: 12(t), 70(f)

nname: 203
n 203(None)[user_config.save()
louie_send('refresh_root', sender='navigator')
return None
]:
	i: 71()
	o: 

nname: 71
n 71(None)[if self._login is not None:
	user_config['net']['login'] = self._login
	log.info("'user' param set for net services'")
	set_param('user', self._login)
if self._password is not None:
	user_config['net']['password'] = self._password
	log.info("'pass' param set for net services'")
	set_param('pass', self._password)
]:
	i: 12(), 0(f)
	o: 203()

nname: 12
n 12(None)[if self.what_to_launch in (0, 2):
	self._password = win.text
else:
	self._login = win.text
win.hide()
]:
	i: 0(t)
	o: 71()

nname: 0
n 0(win is not None)[]:
	i: 
	o: 12(t), 71(f)

nname: 203
n 203(None)[user_config.save()
louie_send('refresh_root', sender='navigator')
return None
]:
	i: 0()
	o: 

nname: 0
n 0(None)[if win is not None:
	if self.what_to_launch in (0, 2):
		self._password = win.text
	else:
		self._login = win.text
	win.hide()
if self._login is not None:
	user_config['net']['login'] = self._login
	log.info("'user' param set for net services'")
	set_param('user', self._login)
if self._password is not None:
	user_config['net']['password'] = self._password
	log.info("'pass' param set for net services'")
	set_param('pass', self._password)
]:
	i: 
	o: 203()

nname: 0
n 0(None)[if win is not None:
	if self.what_to_launch in (0, 2):
		self._password = win.text
	else:
		self._login = win.text
	win.hide()
if self._login is not None:
	user_config['net']['login'] = self._login
	log.info("'user' param set for net services'")
	set_param('user', self._login)
if self._password is not None:
	user_config['net']['password'] = self._password
	log.info("'pass' param set for net services'")
	set_param('pass', self._password)
user_config.save()
louie_send('refresh_root', sender='navigator')
return None
]:
	i: 
	o: 

self.nodes: {0: <unpyclib.structure.node instance at 0xb759312c>}
nname: 6
n 6(None)[def __init__(self):
	self._login = None
	self._password = None
	return None

def launch(self, what_to_launch=2):
	self.what_to_launch = what_to_launch
	if self.what_to_launch in (0, 2):
		self._set_new_login()
	else:
		self._set_new_password()

def _set_new_password(self, win=None):
	if win is not None:
		if self.what_to_launch == 2:
			self._login = win.text
		win.hide()
	kbd = KeyboardWindow(title=_('Enter your password'), confirm_action=self._validate)
	kbd.show()
	return None

def _set_new_login(self):
	if self.what_to_launch == 2:
		pass
	_confirm_action = self._validate
	kbd = KeyboardWindow(title=_('Enter your login'), confirm_action=_confirm_action)
	kbd.show()

def _validate(self, win=None):
	if win is not None:
		if self.what_to_launch in (0, 2):
			self._password = win.text
		else:
			self._login = win.text
		win.hide()
	if self._login is not None:
		user_config['net']['login'] = self._login
		log.info("'user' param set for net services'")
		set_param('user', self._login)
	if self._password is not None:
		user_config['net']['password'] = self._password
		log.info("'pass' param set for net services'")
		set_param('pass', self._password)
	user_config.save()
	louie_send('refresh_root', sender='navigator')
	return None

]:
	i: 
	o: 

self.nodes: {6: <unpyclib.structure.node instance at 0xb758966c>}
nname: 0
n 0(None)[LoginPasswordLauncher().launch(2)
stack.back_one_menu()
]:
	i: 
	o: 

self.nodes: {0: <unpyclib.structure.node instance at 0xb758962c>}
nname: 0
n 0(None)[free_cache()
context['hand_menu'].hide()
louie_send('refresh_root', sender='navigator')
]:
	i: 
	o: 

self.nodes: {0: <unpyclib.structure.node instance at 0xb7589b0c>}
nname: 0
n 0(None)[raise NotImplementedError('Internet services are not enabled in wymedia.')
]:
	i: 
	o: 

self.nodes: {0: <unpyclib.structure.node instance at 0xb758912c>}
nname: 147
n 147(None)[log = GET_LOGGER(__name__)
class LoginPasswordLauncher(object):
	def __init__(self):
		self._login = None
		self._password = None
		return None

	def launch(self, what_to_launch=2):
		self.what_to_launch = what_to_launch
		if self.what_to_launch in (0, 2):
			self._set_new_login()
		else:
			self._set_new_password()

	def _set_new_password(self, win=None):
		if win is not None:
			if self.what_to_launch == 2:
				self._login = win.text
			win.hide()
		kbd = KeyboardWindow(title=_('Enter your password'), confirm_action=self._validate)
		kbd.show()
		return None

	def _set_new_login(self):
		if self.what_to_launch == 2:
			pass
		_confirm_action = self._validate
		kbd = KeyboardWindow(title=_('Enter your login'), confirm_action=_confirm_action)
		kbd.show()

	def _validate(self, win=None):
		if win is not None:
			if self.what_to_launch in (0, 2):
				self._password = win.text
			else:
				self._login = win.text
			win.hide()
		if self._login is not None:
			user_config['net']['login'] = self._login
			log.info("'user' param set for net services'")
			set_param('user', self._login)
		if self._password is not None:
			user_config['net']['password'] = self._password
			log.info("'pass' param set for net services'")
			set_param('pass', self._password)
		user_config.save()
		louie_send('refresh_root', sender='navigator')
		return None



def change_login_pwd_net(context, stack):
	LoginPasswordLauncher().launch(2)
	stack.back_one_menu()

def refresh_net_content(context):
	free_cache()
	context['hand_menu'].hide()
	louie_send('refresh_root', sender='navigator')

]:
	i: 99(), 129(), 145(AE)
	o: 

nname: 145
n 145(None)[]:
	i: 119(f)
	o: 147(AE)

nname: 129
n 129(None)[def free_cache():
	raise NotImplementedError('Internet services are not enabled in wymedia.')

]:
	i: 119(t)
	o: 147()

nname: 119
n 119(<dummy_ex3> EXC_MATCH ImportError)[]:
	i: 0(except)
	o: 129(t), 145(f)

nname: 99
n 99(None)[from wymedia.wmplus import free_cache
]:
	i: 0(try)
	o: 147()

nname: 0
n 0(None)[from __future__ import absolute_import
from peewee.debug import GET_LOGGER
from peewee.messages import send as louie_send
from pygui.config import user_config
from pygui.window.keyboardwindow import KeyboardWindow
from wymedia.wmplus import set_param
]:
	i: 
	o: 99(try), 119(except)

nname: 119
n 119(None)[except ImportError:
	def free_cache():
		raise NotImplementedError('Internet services are not enabled in wymedia.')

log = GET_LOGGER(__name__)
class LoginPasswordLauncher(object):
	def __init__(self):
		self._login = None
		self._password = None
		return None

	def launch(self, what_to_launch=2):
		self.what_to_launch = what_to_launch
		if self.what_to_launch in (0, 2):
			self._set_new_login()
		else:
			self._set_new_password()

	def _set_new_password(self, win=None):
		if win is not None:
			if self.what_to_launch == 2:
				self._login = win.text
			win.hide()
		kbd = KeyboardWindow(title=_('Enter your password'), confirm_action=self._validate)
		kbd.show()
		return None

	def _set_new_login(self):
		if self.what_to_launch == 2:
			pass
		_confirm_action = self._validate
		kbd = KeyboardWindow(title=_('Enter your login'), confirm_action=_confirm_action)
		kbd.show()

	def _validate(self, win=None):
		if win is not None:
			if self.what_to_launch in (0, 2):
				self._password = win.text
			else:
				self._login = win.text
			win.hide()
		if self._login is not None:
			user_config['net']['login'] = self._login
			log.info("'user' param set for net services'")
			set_param('user', self._login)
		if self._password is not None:
			user_config['net']['password'] = self._password
			log.info("'pass' param set for net services'")
			set_param('pass', self._password)
		user_config.save()
		louie_send('refresh_root', sender='navigator')
		return None



def change_login_pwd_net(context, stack):
	LoginPasswordLauncher().launch(2)
	stack.back_one_menu()

def refresh_net_content(context):
	free_cache()
	context['hand_menu'].hide()
	louie_send('refresh_root', sender='navigator')

]:
	i: 0()
	o: 

nname: 0
n 0(None)[from __future__ import absolute_import
from peewee.debug import GET_LOGGER
from peewee.messages import send as louie_send
from pygui.config import user_config
from pygui.window.keyboardwindow import KeyboardWindow
from wymedia.wmplus import set_param
try:
	from wymedia.wmplus import free_cache
]:
	i: 
	o: 119()

nname: 0
n 0(None)[from __future__ import absolute_import
from peewee.debug import GET_LOGGER
from peewee.messages import send as louie_send
from pygui.config import user_config
from pygui.window.keyboardwindow import KeyboardWindow
from wymedia.wmplus import set_param
try:
	from wymedia.wmplus import free_cache
except ImportError:
	def free_cache():
		raise NotImplementedError('Internet services are not enabled in wymedia.')

log = GET_LOGGER(__name__)
class LoginPasswordLauncher(object):
	def __init__(self):
		self._login = None
		self._password = None
		return None

	def launch(self, what_to_launch=2):
		self.what_to_launch = what_to_launch
		if self.what_to_launch in (0, 2):
			self._set_new_login()
		else:
			self._set_new_password()

	def _set_new_password(self, win=None):
		if win is not None:
			if self.what_to_launch == 2:
				self._login = win.text
			win.hide()
		kbd = KeyboardWindow(title=_('Enter your password'), confirm_action=self._validate)
		kbd.show()
		return None

	def _set_new_login(self):
		if self.what_to_launch == 2:
			pass
		_confirm_action = self._validate
		kbd = KeyboardWindow(title=_('Enter your login'), confirm_action=_confirm_action)
		kbd.show()

	def _validate(self, win=None):
		if win is not None:
			if self.what_to_launch in (0, 2):
				self._password = win.text
			else:
				self._login = win.text
			win.hide()
		if self._login is not None:
			user_config['net']['login'] = self._login
			log.info("'user' param set for net services'")
			set_param('user', self._login)
		if self._password is not None:
			user_config['net']['password'] = self._password
			log.info("'pass' param set for net services'")
			set_param('pass', self._password)
		user_config.save()
		louie_send('refresh_root', sender='navigator')
		return None



def change_login_pwd_net(context, stack):
	LoginPasswordLauncher().launch(2)
	stack.back_one_menu()

def refresh_net_content(context):
	free_cache()
	context['hand_menu'].hide()
	louie_send('refresh_root', sender='navigator')

]:
	i: 
	o: 

self.nodes: {0: <unpyclib.structure.node instance at 0xb75818cc>}
from __future__ import absolute_import
from peewee.debug import GET_LOGGER
from peewee.messages import send as louie_send
from pygui.config import user_config
from pygui.window.keyboardwindow import KeyboardWindow
from wymedia.wmplus import set_param
try:
	from wymedia.wmplus import free_cache
except ImportError:
	def free_cache():
		raise NotImplementedError('Internet services are not enabled in wymedia.')

log = GET_LOGGER(__name__)
class LoginPasswordLauncher(object):
	def __init__(self):
		self._login = None
		self._password = None
		return None

	def launch(self, what_to_launch=2):
		self.what_to_launch = what_to_launch
		if self.what_to_launch in (0, 2):
			self._set_new_login()
		else:
			self._set_new_password()

	def _set_new_password(self, win=None):
		if win is not None:
			if self.what_to_launch == 2:
				self._login = win.text
			win.hide()
		kbd = KeyboardWindow(title=_('Enter your password'), confirm_action=self._validate)
		kbd.show()
		return None

	def _set_new_login(self):
		if self.what_to_launch == 2:
			pass
		_confirm_action = self._validate
		kbd = KeyboardWindow(title=_('Enter your login'), confirm_action=_confirm_action)
		kbd.show()

	def _validate(self, win=None):
		if win is not None:
			if self.what_to_launch in (0, 2):
				self._password = win.text
			else:
				self._login = win.text
			win.hide()
		if self._login is not None:
			user_config['net']['login'] = self._login
			log.info("'user' param set for net services'")
			set_param('user', self._login)
		if self._password is not None:
			user_config['net']['password'] = self._password
			log.info("'pass' param set for net services'")
			set_param('pass', self._password)
		user_config.save()
		louie_send('refresh_root', sender='navigator')
		return None



def change_login_pwd_net(context, stack):
	LoginPasswordLauncher().launch(2)
	stack.back_one_menu()

def refresh_net_content(context):
	free_cache()
	context['hand_menu'].hide()
	louie_send('refresh_root', sender='navigator')

